
#
# class Solution:
#
#     def mult(self, p):
#         res = 1
#         for i in range(1, p+1):
#             res *= i
#         return res
#
#     def c(self, m, n):
#         res = self.mult(m)/(self.mult(n)*self.mult(m-n))
#         res_ = int(res)
#         return res_
#
#     def climbStairs(self, n):
#         """
#         type n: int
#         :return:int
#         """
#         two = n - 2
#         position = n - 1
#         total = 0
#         if position > 0:
#             for i in range(1, two+1):
#                 print(i)
#                 total += self.c(position, i)
#         result = total + 1
#         print(result)
#         return result
class Solution:

    def climbStairs(self, n):
        p = 0
        q = 0
        r = 1
        i = 1
        while i <= n:
            p = q
            q = r
            r = p + q
            i += 1
        print(r)
        return r


if __name__ == '__main__':
    sol = Solution()
    sol.climbStairs(3)
